<?php defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<fieldset class="adminform">
<table>
	<tr>
		<td align="left" width="100%">
			<?php echo JText::_( 'Filter' ); ?>:
			<input type="text" name="search" id="search" value="<?php echo $this->lists['search']; ?>" class="text_area" onchange="document.adminForm.submit();" />
			<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
			<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
		</td>
		<td nowrap="nowrap">
			<?php echo $this->lists['state']; ?>
		</td>
	</tr>
</table>
<table class="adminlist">
<thead>
	<tr>
		<th width="5">
			<?php echo JText::_( 'NUM' ); ?>
		</th>
		
		<th width="20">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
		</th>
		
		<th class="title" align="left">
			<?php echo JText::_( 'NAME' )?>
		</th>
		
		<th width="80" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort', JText::_( 'PUBLISHED' ), 'published', 
			$this->lists['order_Dir'], $this->lists['order'], 'profiles' ); ?>	
		</th>
		
		<th width="50" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort',  JText::_( 'ORDER' ), 'ordering', 
			$this->lists['order_Dir'], $this->lists['order'], 'profiles' ); ?>
	 	</th>
	 			 
		<th width="50" align="center">
			<?php echo JHTML::_('grid.order',  $this->items ); ?>
		</th>
	</tr>
</thead>	
<tfoot>
	<tr>
		<td colspan="7">
			<?php echo $this->pagination->getListFooter(); ?>
		</td>
	</tr>
</tfoot>
<?php
$k = 0;

for ($i=0; $i<count($this->items); $i++)
{
	$row = &$this->items[$i];
	$editLink 	= JRoute::_( 'index.php?option=com_igallery&amp;controller=igprofile&amp;view=add_edit_profile&amp;cid[]='. $row->id );
	$checked 	= JHTML::_('grid.id',   $i, $row->id );
	$published 	= JHTML::_('grid.published', $row, $i);
	?>
	<tr class="<?php echo "row$k"; ?>">
		<td>
			<?php echo $this->pagination->getRowOffset($i); ?>
		</td>
		
		<td>
			<?php echo $checked; ?>
		</td>
		
		<?php
		if( strlen($row->name) < 1)
		{
			$row->name = '____';
		}
		?>
		<td align="left">
			<a href="<?php echo $editLink;?>"><?php echo $row->name;?></a>
		</td>
		
		<td align="center">
			<?php echo $published;?>
		</td>
		
		<td class="order" colspan="2">
			<span><?php echo $this->pagination->orderUpIcon($i, true, 'orderup', 'Move Up', isset($this->items[$i-1]) ); ?></span>
			<span><?php echo $this->pagination->orderDownIcon($i, count($this->items), true, 'orderdown', 'Move Down', isset($this->items[$i+1]) ); ?></span>
			<input type="text" name="order[]" size="5" value="<?php echo $row->ordering;?>" class="text_area" style="text-align: center" />
		</td>
		
	</tr>
	<?php
	$k = 1 - $k;
}
?>

</table>

<input type="hidden" name="option" value="com_igallery" />
<input type="hidden" name="controller" value="igprofile" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
</fieldset>
</form>

